<template>
  <div class="app-container">
    <div class="item2">
      <div class="header">
        <div class="title1">
          <i class="el-icon-data-analysis"></i><span>收货验收记录</span>
        </div>
        <!-- <div class="backB">
          <img src="@/assets/images/back.png" alt="" @click="goBack" />
        </div> -->
      </div>
      <div class="formCenter">
        <el-form
          :model="queryParams"
          size="large"
          :inline="true"
          ref="queryForm"
          label-width="110px"
        >
          <el-form-item label="货主编号:" prop="fmcustomerId">
            <el-input
              v-model="queryParams.fmcustomerId"
              placeholder="请输入货主编号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="下单方:" prop="xdf">
            <el-input
              v-model="queryParams.xdf"
              placeholder="请输入下单方"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="随货同行单号:" prop="poreference1">
            <el-input
              v-model="queryParams.poreference1"
              placeholder="请输入随货同行单号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="验收单号:" prop="asnNo">
            <el-input
              v-model="queryParams.asnNo"
              placeholder="请输入验收单号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="商品编码:" prop="sku">
            <el-input
              v-model="queryParams.sku"
              placeholder="请输入商品编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="产品编码:" prop="skudescr2">
            <el-input
              v-model="queryParams.skudescr2"
              placeholder="请输入产品编码"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="批号:" prop="lotatt04">
            <el-input
              v-model="queryParams.lotatt04"
              placeholder="请输入批号"
              clearable
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <!-- <el-form-item label="订单类型:" prop="ywlx">
            <el-select v-model="queryParams.ywlx" placeholder="请选择">
              <el-option
                v-for="item in ywlxType"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </el-select>
          </el-form-item> -->
          <el-form-item label="时间:">
            <el-date-picker
              v-model="redateRange"
              style="width: 240px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <div class="btn">
              <el-button
                type="primary"
                icon="el-icon-search"
                size="medium"
                @click="handleQuery"
                >搜索</el-button
              >
              <el-button
                type="primary"
                icon="el-icon-refresh"
                size="medium"
                @click="resetQuery"
                >重置</el-button
              >
            </div>
          </el-form-item>
        </el-form>
        <!-- <div class="deliverybtn">
          <el-button
            type="primary"
            icon="el-icon-search"
            size="medium"
            @click="handleQuery"
            >搜索</el-button
          >
          <el-button
            type="primary"
            icon="el-icon-refresh"
            size="medium"
            @click="resetQuery"
            >重置</el-button
          >
        </div> -->
      </div>
      <el-table
        :data="tableData"
        border
        height="680"
        v-loading="loading"
        element-loading-text="拼命加载中"
        element-loading-spinner="el-icon-loading"
        :header-cell-style="{ background: '#1890ff', color: '#ffffff' }"
      >
        <!-- <el-table-column
          align="center"
          prop="xcsj"
          label="订单下传时间"
          width="160"
        >
        </el-table-column> -->
        <el-table-column align="center" prop="fmcustomerId" label="货主编号">
        </el-table-column>
        <el-table-column
          align="center"
          prop="hzmc"
          label="货主名称"
          width="200"
        >
        </el-table-column>
        <el-table-column align="center" prop="rq" label="入库日期" width="160">
        </el-table-column>
        <el-table-column align="center" prop="xdf" label="下单方" width="150">
        </el-table-column>
        <el-table-column
          align="center"
          prop="poreference1"
          label="随货同行单号"
          width="150"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="skudescr2"
          label="产品编码"
          width="150"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="asnNo"
          label="验收编号"
          width="170"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="ywlx"
          label="订单类型"
          width="130"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="supplierId"
          label="单位编号"
          width="170"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="supplierName"
          label="单位名称"
          width="200"
        >
        </el-table-column>
        <el-table-column align="center" prop="sku" label="商品编号" width="180">
        </el-table-column>
        <el-table-column
          align="center"
          prop="skuDescr1"
          label="商品名称"
          width="180"
        >
        </el-table-column>
        <el-table-column align="center" prop="freightClass" label="货物类型">
        </el-table-column>
        <el-table-column align="center" prop="jx" label="剂型" width="100">
        </el-table-column>
        <el-table-column
          align="center"
          prop="gg"
          label="规格/型号、规格"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="bzdw"
          label="包装单位"
          width="130"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="cctj"
          label="储存/贮存条件"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="dhsl"
          label="到货数量"
          width="100"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="udf03"
          label="拒收数量"
          width="100"
        >
        </el-table-column>
        <el-table-column align="center" prop="jzl" label="件包装" width="100">
        </el-table-column>
        <el-table-column align="center" prop="js" label="件数" width="100">
        </el-table-column>
        <el-table-column
          align="center"
          prop="alternateSku4"
          label="生产厂家/受托生产企业名称"
          width="210"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="reservedfield07"
          label="上市许可持有人/医疗器械注册人、备案人"
          width="210"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="alternateSku5"
          label="产地"
          width="210"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotatt04"
          label="生产批号/序列号"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotAtt01"
          label="生产日期"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotAtt13"
          label="生产日期格式"
          width="120"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="lotAtt02"
          label="有效期至/使用期限/失效日期"
          width="130"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="approvalNo"
          label="批准文号/注册证/备案凭证号"
          width="190"
        >
        </el-table-column>
        <el-table-column align="center" prop="sdy" label="审单员" width="160">
        </el-table-column>
        <el-table-column align="center" prop="shy" label="收货员" width="160">
        </el-table-column>
        <el-table-column align="center" prop="ldy" label="录单员" width="160">
        </el-table-column>
        <el-table-column
          align="center"
          prop="shsj"
          label="录单时间"
          width="180"
        >
        </el-table-column>
        <el-table-column align="center" prop="ysy" label="验收员" width="160">
        </el-table-column>
        <el-table-column
          align="center"
          prop="deysy"
          label="第二验收员"
          width="160"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="yssj"
          label="验收时间"
          width="160"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="ysjg"
          label="验收结果"
          width="160"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="hgsl"
          label="验收合格或不合格数量"
          width="130"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="bhgcs"
          label="不合格事项及处理意见"
          width="130"
        >
        </el-table-column>
        <el-table-column align="center" prop="sjy" label="上架员" width="160">
        </el-table-column>
        <el-table-column
          align="center"
          prop="sjsj"
          label="上架时间"
          width="160"
        >
        </el-table-column>
        <el-table-column align="center" prop="dj" label="单价" width="130">
        </el-table-column>
        <el-table-column align="center" prop="je" label="金额">
        </el-table-column>
        <el-table-column align="center" prop="udf06" label="退回原因">
        </el-table-column>
        <el-table-column align="center" prop="qysj" label="起运时间">
        </el-table-column>
        <el-table-column align="center" prop="qywd" label="起运温度">
        </el-table-column>
        <el-table-column
          align="center"
          prop="dhsj"
          label="到达时间(收货时间)"
          width="160"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="dhwd"
          label="到达温度"
          width="160"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="vehicleNo"
          label="车牌号"
          width="160"
        >
        </el-table-column>
        <el-table-column align="center" prop="driver" label="司机" width="160">
        </el-table-column>
        <el-table-column align="center" prop="fs" label="温控方式" width="160">
        </el-table-column>
        <el-table-column align="center" prop="gj" label="运输工具" width="160">
        </el-table-column>
        <el-table-column
          align="center"
          prop="ysdw"
          label="运输单位"
          width="160"
        >
        </el-table-column>
        <el-table-column
          align="center"
          prop="address1"
          label="发货地址"
          width="200"
        >
        </el-table-column>
      </el-table>
      <!-- <div>
        <pagination
          v-show="total > 0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="handleQuery"
        />
      </div> -->
    </div>
  </div>
</template>

<script>
import { listdelivery } from "@/api/system/conserve";
export default {
  dicts: ["floor_type", "taskprocess_type", "taskprocessmsg_type"],
  data() {
    return {
      // 总条数
      total: 0,
      //   addTime: [
      //     new Date().toISOString().split("T")[0],
      //     new Date().toISOString().split("T")[0],
      //   ],
      ywlxType: [
        {
          value: "采购入库",
          label: "采购入库",
        },
        {
          value: "销售退回",
          label: "销售退回",
        },
      ],
      queryParams: {
        // pageNum: 1,
        // pageSize: 20,
        fmcustomerId: "",
        xdf: "",
        skudescr2: "",
        lotatt04: "",
        sku: "",
        asnNo: "",
        // ywlx: "",
        poreference1: "",
      },
      tableData: [],
      loading: false,
      redateRange: [],
    };
  },
  mounted() {
    // this.handleQuery();
  },
  methods: {
    goBack() {
      this.$router.push("/subSystem1");
    },
    handleQuery() {
      this.$refs.queryForm.validate((valid) => {
        if (valid) {
          this.queryParams.params = {};
          if (null != this.redateRange && "" != this.redateRange) {
            this.queryParams.params["beginTime"] = this.redateRange[0];
            this.queryParams.params["endTime"] = this.redateRange[1];
          }
          if (
            this.queryParams.params["beginTime"] &&
            this.queryParams.params["endTime"]
          ) {
            this.loading = true;
            listdelivery(this.queryParams).then((res) => {
              this.tableData = res.data;
              this.total = res.total;
              this.loading = false;
            });
          } else {
            this.loading = false;
            this.$message.error("请选择查询时间");
          }
        }
      });
    },
    resetQuery() {
      this.resetForm("queryForm");
      this.redateRange = [];
    },
    handleExport() {
      this.download(
        "system/lzBb/export",
        {
          ...this.queryParams,
        },
        `post_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
<style lang="scss" scoped>
.app-container {
  .el-icon-data-analysis::before {
    color: #00d9ff;
    margin-right: 8px;
  }
  .title1 {
    font-size: 16px;
    // margin-bottom: 15px;
    color: #808080;
    width: 135px;
    padding: 5px;
    border-bottom: 1px dotted #8ddfff;
  }
  .header {
    margin-top: -10px;
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .el-date-editor.el-input,
    .el-date-editor.el-input__inner {
      width: 220px;
      margin-right: 20px;
    }

    .backB {
      cursor: pointer;

      img {
        width: 20%;
      }
    }
  }
  .formCenter {
    min-height: 100px;
    display: flex;
    justify-content: center;
    // justify-content: space-between;
    align-items: center;
    .btn {
      // margin-left: 130px;
    }
    // .deliveryform{
    //     width: 85%;
    // }
    // .deliverybtn{
    //     width: 15%;
    //     display: flex;
    // }
    ::v-deep .el-input--suffix .el-input__inner {
      width: 240px;
    }
  }
  .footer {
    margin-top: 20px;
    width: 100%;
    min-height: 200px;
  }
  .el-select {
    width: 240px;
  }
  // 表格有滚动条使暂无数据居中
  ::v-deep .el-table__empty-block {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  //   滚动条宽度
  ::v-deep .el-table__body-wrapper::-webkit-scrollbar {
    width: 10px; // 横向滚动条
    height: 10px; // 纵向滚动条 必写
  }
}
</style>